function hideElements(id, tableId){
	var elem=document.getElementById(id);
	var index=elem.rowIndex;
	var table=document.getElementById(tableId);
	var numElem=document.getElementById(id+'NrElems').value;
	//alert(numElem);
	for(var i=1; i<=numElem; i++){
		var newRow=table.rows[index+i];
		if(newRow.className=='hidden'){
			newRow.className='visible';
		}else{
			newRow.className='hidden';
		}
	}
}

function hideDivs(id){
	var id1='';
	var id2='';

	if(id=='divDescr'){
		id1='divDescr';
		id2='divAuth';
	}else{
		id1='divAuth';
		id2='divDescr';
	}

	var div1=document.getElementById(id1);
	var div2=document.getElementById(id2);

	if(div1.className=='newProjShow'){
		div1.className='newProjHidden';
		div2.className='newProjShow';
	}
}

function popup(){
	newwindow=window.open('http://localhost/phpProjects/xmlDocument/stuff/css/#','name','height=250,width=350');
	if (window.focus){
		newwindow.focus();
	}
	return false;
}

function submitForm(id){
	var form=document.getElementById(id);
	form.submit();
}

function showContentPane(){
	var elem=document.getElementById('docContent');
	var index=elem.rowIndex;
	var table=document.getElementById('anunturi');
	var numElem=document.getElementById('docContentNrElems').value;
	//alert(numElem);
	for(var i=1; i<=numElem; i++){
		var newRow=table.rows[index+i];
		if(newRow.className=='hidden'){
			newRow.className='visible';
		}
	}
	var elem=document.getElementById('file');
	var index=elem.rowIndex;
	var table=document.getElementById('anunturi');
	var numElem=document.getElementById('fileNrElems').value;
	//alert(numElem);
	for(var i=1; i<=numElem; i++){
		var newRow=table.rows[index+i];
		if(newRow.className=='hidden'){
			newRow.className='visible';
		}
	}
}

function setOpenDocVar(docName){
	var form=document.getElementById('openServDoc');
	var hidden=document.getElementById('procOpenServDoc');
	hidden.value=docName;
	form.submit();
}

function generateRandomNumber(){
	A=99;
	B=999999999;
	num =Math.round( A + (B-A)*Math.random());
	return num;
}